/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-09-06     Wangjiangbo       the first version
 */
#ifndef __BSP_COMM_H__
#define __BSP_COMM_H__

#if 1   //变量类型定义相关


///**
//FALSE: Will be used for variables from type BOOL */
//#ifndef FALSE
//#define FALSE                                     0
//#endif
//
///**
//TRUE: Will be used for variables from type BOOL  */
//#ifndef TRUE
//#define TRUE                                      1
//#endif


/**
BOOL: Should be adapted to the boolean type of the microcontroller */
#ifndef BOOL
#define BOOL                                      unsigned char
#endif

/**
UINT8: Should be adapted to the unsigned8 type of the microcontroller  */
#ifndef UINT8
#define UINT8                                     unsigned char
#endif

/**
UINT16: Should be adapted to the unsigned16 type of the microcontroller  */
#ifndef UINT16
#define UINT16                                    unsigned short
#endif

/**
UINT32: Should be adapted to the unsigned32 type of the microcontroller  */
#ifndef UINT32
#define UINT32                                    unsigned long
#endif

/**
USHORT: Should be adapted to the unsigned16 type of the microcontroller */
#ifndef USHORT
#define USHORT                                    unsigned short
#endif

/**
INT8: Should be adapted to the integer8 type of the microcontroller */
#ifndef INT8
#define INT8                                      signed char
#endif

/**
INT16: Should be adapted to the integer16 type of the microcontroller  */
#ifndef INT16
#define INT16                                     short
#endif

/**
INT32: Should be adapted to the integer32 type of the microcontroller */
#ifndef INT32
#define INT32                                     long
#endif

/**
CHAR: Should be adapted to the character type of the microcontroller */
#ifndef CHAR
#define CHAR                                      char
#endif

/**
UCHAR: Should be adapted to the unsigned character type of the microcontroller */
#ifndef UCHAR
#define UCHAR                                     unsigned char
#endif

/**
SIZEOF(x): Used to calculate the size in Bytes */
#ifndef SIZEOF
#define SIZEOF(x)                                 sizeof(x)
#endif

/**
HMEMSET: Should be defined to the memset function for huge memory, if the microcontroller<br>
does not support a huge type, HMEMSET shall be defined to a 'normal' memset function */
#ifndef HMEMSET
#define HMEMSET                                   memset
#endif

/**
HMEMCPY: Should be defined to the memcpy function for huge memory, if the microcontroller<br>
does not support a huge type, HMEMCPY shall be defined to a 'normal' memcpy function */
#ifndef HMEMCPY
#define HMEMCPY                                   memcpy
#endif

/**
HMEMCMP: Should be defined to the memcmp function for huge memory, if the microcontroller<br>
does not support a huge type, HMEMCMP shall be defined to a 'normal' memcmp function */
#ifndef HMEMCMP
#define HMEMCMP                                   memcmp
#endif


/**
VARVOLATILE: Should be used to prevent dummy variables to be deleted due to compiler optimization.  */
#ifndef VARVOLATILE
#define VARVOLATILE                               volatile
#endif
#endif


#if 1   //数学相关

#define SQRT2               (1.4142135623730950488016887242097f)
#define ONE_BY_SQRT2        (1/SQRT2)

#define SQRT3               (1.7320508075688772935274463415059f)
#define ONE_BY_SQRT3        (1/SQRT3)

#endif

#endif /* APPLICATIONS_BSP_BSP_COMM_H_ */
